def bubbleSort(numbers):
    count = 0
    n = len(numbers)
    for i in range(n):
        swapped = False
        for j in range(0, n - i - 1):
            if numbers[j] > numbers[j + 1]:
                numbers[j], numbers[j + 1] = numbers[j + 1], numbers[j]
                count += 1
                swapped = True
        if not swapped:
            break  # 提前终止（若已有序）
    return count